/****************************************************************************
** @brief
****************************************************************************/

#ifndef CARDPUYUE_H
#define CARDPUYUE_H

#include "abstractCard.h"

class CardPuyue : public AbstractCard
{
    Q_OBJECT

public:
    ///
    /// \brief The CardCmd enum
    ///
    enum CardCmd {
        kSearchLabel = 0x16,      /* 查询场内标签 */
        kReadM1DataBlock = 0x70,  /* 授权读M1数据块 */
    };

    CardPuyue(enum CardType cardType, QObject *parent = nullptr);
    ~CardPuyue();

    virtual void TestSerial();

protected:

private:
    ///
    /// \brief Construct 构造数据
    /// \param cmd
    /// \return
    ///
    QByteArray Construct(enum CardCmd cmd);

    ///
    /// \brief CalcCRC16
    /// \param data
    /// \param len
    /// \return
    ///
    unsigned int CalcCRC16(unsigned char *data, unsigned int len);

signals:

public slots:
    virtual void SearchCard();

private slots:
    void HandleSerialData();
};

#endif // CARDPUYUE_H
